Skip to content

fix(desktop): find every bridge action source instead of listing them - #11990

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/flow-lint-bridge-discovery
Aug 22, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/flow-lint-bridge-discovery

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

desktop_flow_contract exists so "an added bridge action cannot skip its flow validation route" — its own words. The list it relies on is hand-maintained, and it has now gone stale twice in two days.

When a bridge file is missing from the list, the lint cannot see the actions it registers and reports the flows using them as referencing actions that do not exist:

notifications-settings.yaml: unknown bridge action 'settings_notifications_snapshot'
notifications-settings.yaml: unknown bridge action 'set_notification_settings'

Because scripts/pre-push lints every flow rather than the diff, that fails the push gate on every branch cut from main — on a file the pusher never touched. I hit it pushing something unrelated and confirmed it reproduces on a clean origin/main checkout.

This fixes the mechanism, not an outage

Both instances are already patched on main by hand — +Notifications.swift, then +ChatFirst.swift. main's own comment records the pattern:

main fixed +Notifications independently; +ChatFirst had the same gap.

That is the argument for this change. The list drifted, was patched, drifted again, was patched again. The next bridge extension will do the same, and take the push gate down with it for everyone.

The change

Bridge sources are discovered by filename prefix instead of listed.

Scoped to that one prefix deliberately. The pattern the lint matches, name: "…", also appears in APIClient, AuthService and ChatBubble, so scanning the tree would feed the lint names that are not actions and quietly weaken it. The prefix belongs to the bridge and nothing else — the curated list is the right shape, and only its bridge entries needed to stop being hand-maintained.

Three files, found rather than named:

file actions
DesktopAutomationBridge.swift 125
DesktopAutomationBridge+Notifications.swift 3
DesktopAutomationBridge+ChatFirst.swift 0

Verification

python3 desktop/macos/scripts/desktop-flow-lint.py
  -> desktop-flow-lint OK (72 flows, 164 registered actions)

python3 desktop/macos/tests/test_desktop_flow_contract.py   -> 3 passed
python3 .github/scripts/test_run_checks.py                  -> 47 passed

Tests proven by reverting to the hand-maintained list: two of the three fail and the lint reproduces the original errors. A test that has never failed is not evidence.

Wired into .github/checks-manifest.yaml in both lanes as desktop-flow-contract-tests.

Product invariants affected

none

Failure class (fixes)

Failure-Class: none

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@aryanorastar
aryanorastar force-pushed the fix/flow-lint-bridge-discovery branch from 6206b72 to 043d5b0 Compare August 21, 2026 04:37
`desktop_flow_contract` exists so "an added bridge action cannot skip its flow
validation route" — its own words. It failed at exactly that.

Three actions live in `DesktopAutomationBridge+Notifications.swift`. The
hand-maintained `ACTION_SOURCE_RELATIVE_PATHS` named only the base
`DesktopAutomationBridge.swift`, so the lint never read them and reported the
flows using them as referencing actions that do not exist:

    notifications-settings.yaml: unknown bridge action 'settings_notifications_snapshot'
    notifications-settings.yaml: unknown bridge action 'set_notification_settings'

Because `scripts/pre-push` lints every flow rather than the diff, that failed the
push gate on every branch cut from main, on a file the pusher never touched.

That instance is already fixed: `DesktopAutomationBridge+Notifications.swift` was
added to the list by hand on main while this was being written. This change is
about the recurrence, not the instance — the list is hand-maintained, so the next
bridge file added goes unlisted the same way and takes the push gate down with it
again.

Bridge sources are now discovered by their filename prefix. Scoped to that one
prefix deliberately: the pattern the lint matches, `name: "…"`, also appears in
`APIClient`, `AuthService` and `ChatBubble`, so scanning the tree would feed it
names that are not actions and weaken the check. The prefix belongs to the bridge
and nothing else, which is why the curated list is the right shape and only its
bridge entries needed to stop being hand-maintained.

Discovery finds three files where the list named two:

    Desktop/Sources/DesktopAutomationBridge.swift                (125 actions)
    Desktop/Sources/DesktopAutomationBridge+Notifications.swift  (3)
    Desktop/Sources/DesktopAutomationBridge+ChatFirst.swift      (0)

`+ChatFirst` registers nothing today. It is the case this is for: a file that
exists, is not listed, and would silently take actions out of validation the day
someone adds one to it.

Verification:
  python3 desktop/macos/scripts/desktop-flow-lint.py
    -> desktop-flow-lint OK (72 flows, 162 registered actions)
  python3 desktop/macos/tests/test_desktop_flow_contract.py      -> 3 passed
  python3 .github/scripts/test_run_checks.py                     -> 47 passed

  Tests proven by reverting to the hand-maintained list: two of the three fail
  and the lint reproduces the original two errors.

Wired into the check manifest in both lanes as `desktop-flow-contract-tests`.

Failure-Class: none
@aryanorastar
aryanorastar force-pushed the fix/flow-lint-bridge-discovery branch from 043d5b0 to e1ebb4c Compare August 21, 2026 18:34
Desktop Swift Static & Test Contracts failed on
KernelTurnRecordedProjectionTests.testFaultHarnessResetUsesCredentialFreeControlClearOnceAndCompletesProjectionReset,
a kernel-projection fault-harness test in a subsystem this PR does not touch.
The same CI window produced two other unrelated Swift test failures on other
PRs, each a different test. No code change.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Desktop owner-override bug fix: hand-maintained bridge action list went stale twice, now discovered by filename prefix. CI green, confirmed not fixed on main.

@kodjima33
kodjima33 merged commit f7e025c into BasedHardware:main Aug 22, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants